-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Mavis Market to nft.trades #7355
base: main
Are you sure you want to change the base?
Conversation
Added Ronin
…nin/platforms/_schema.yml to dbt_subprojects/nft/models/_sector/trades/chains/ronin/nft_ronin_base_trades.sql
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some questions/comments around data QA.
It would also be nice to add a seed test to the model.
You can see how that is done for collectionswap here:
seed: https://github.com/duneanalytics/spellbook/blob/main/dbt_subprojects/nft/seeds/trades/base_trades/collectionswap_ethereum_base_trades_seed.csv
schema:
spellbook/dbt_subprojects/nft/seeds/trades/base_trades/_schema.yml
Lines 196 to 206 in 6a2d09f
- name: collectionswap_ethereum_base_trades_seed | |
config: | |
column_types: | |
tx_hash: varbinary | |
buyer: varbinary | |
seller: varbinary | |
nft_contract_address: varbinary | |
price_raw: uint256 | |
platform_fee_amount_raw: uint256 | |
royalty_fee_amount_raw: uint256 | |
nft_token_id: uint256 |
test:
spellbook/dbt_subprojects/nft/models/_sector/trades/chains/ethereum/platforms/_schema.yml
Lines 573 to 586 in 6a2d09f
- check_seed: | |
seed_file: ref('collectionswap_ethereum_base_trades_seed') | |
match_columns: | |
- block_number | |
- tx_hash | |
- sub_tx_trade_id | |
check_columns: | |
- buyer | |
- seller | |
- nft_contract_address | |
- nft_token_id | |
- price_raw | |
- platform_fee_amount_raw | |
- royalty_fee_amount_raw |
quantity as nft_amount, | ||
seller, | ||
buyer, | ||
'' as trade_category, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 'Buy' or 'Sell'.
If it's not possible to determine the trade direction, feel free to just set 'Buy' as the default.
seller, | ||
buyer, | ||
'' as trade_category, | ||
'' as trade_type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 'secondary'
cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.erc') as double) as erc, | ||
FROM_HEX(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.addr')) as nft_contract_address, | ||
cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.id') as double) as nft_token_id, | ||
cast(json_extract_scalar(replace(json_extract_scalar(json_parse(json_extract_scalar("order", '$.info')),'$.assets[0]'),'\\', ''),'$.quantity') as double) as quantity, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to return 0 in quite some cases, it should always be 1 or greater
contract_address as project_contract_address, | ||
tx_hash, | ||
platform_address as platform_fee_address, | ||
platform_fee_amount_raw, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always returns 200
currently which seems to be the ratio and not the actual raw value?
-- axie_fee_amount_raw, | ||
-- ronin_treasury_fee_amount_raw, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you want, you can keep these in this model.
They won't make it into nft.trades
but at least they'll be available in the project specific model.
Thank you for contributing to Spellbook 🪄
Please open the PR in draft and mark as ready when you want to request a review.
Description:
[...]
quick links for more information: